﻿namespace CalSum
{
    class Program
    {
        int getMax(int[] input)
        {
            int result = input[0];
            for (int i = 0; i < input.Length; i++)
            {
                if (result < input[i])
                    result = input[i];
            }
            return result;
        }

        int getMin(int[] input)
        {
            int result = input[0];
            for (int i = 0; i < input.Length; i++)
            {
                if (result > input[i])
                    result = input[i];
            }
            return result;
        }

        int getAverage(int[] input)
        {
            int result = input[0];
            for (int i = 1; i < input.Length; i++)
            {
                result += input[i];
            }
            return result / input.Length;
        }

        int getSum(int[] input)
        {
            int result = input[0];
            for (int i = 1; i < input.Length; i++)
            {
                result += input[i];
            }
            return result;
        }

        static void Main(string[] args)
        {
            int[] arr = {1,2,3,4,5,6,7,8,9,10};
            Program p=new Program();
            Console.WriteLine(p.getMax(arr));
            Console.WriteLine(p.getMin(arr));
            Console.WriteLine(p.getAverage(arr));
            Console.WriteLine(p.getSum(arr));
        }
    }
}
